import Vue from 'vue';
import App from './App';
// Vue.prototype.G_base = 'http://106.12.157.185'
// Vue.prototype.G_base = 'http://154.210.1.41/'
// Vue.prototype.G_base = 'http://121.36.45.234/'
Vue.prototype.G_base = 'http://hx.redbox.org.cn/'
// Vue.prototype.G_base = 'http://39.102.71.94/'
import store from './store/index.js'
Vue.config.productionTip = false;
// let main = plus.android.runtimeMainActivity();
// plus.runtime.quit = function() {
//     main.moveTaskToBack(false);
// };
// plus.nativeUI.toast = (function(str) {
//     if (str =='再次返回退出应用') {
//         plus.runtime.quit();
//     } else {
//         uni.showToast({
//             title: '再次返回退出应用',
//             icon: 'none'
//         })
//     }
// });
Vue.mixin({
	methods: {
		setData: function(obj, callback) {
			let that = this;
			let keys = [];
			let val, data;
			Object.keys(obj).forEach(function(key) {
				keys = key.split('.');
				val = obj[key];
				data = that.$data;
				keys.forEach(function(key2, index) {
					if (index + 1 == keys.length) {
						that.$set(data, key2, val);
					} else {
						if (!data[key2]) {
							that.$set(data, key2, {});
						}
					}
					data = data[key2];
				})
			});
			callback && callback();
		} 
	}
});

App.mpType = 'app';

const app = new Vue({
    ...App,
	store
});
app.$mount();
